package com.crossriver.crgis.portlet;

import java.io.IOException;

import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;

/**
 * Portlet implementation class SimpleNavigation
 */
public class SimpleNavigation extends MVCPortlet {
	
	// logger
	private static Log log = LogFactory.getLog(SimpleNavigation.class);
 
	@Override
	public void doView(
			RenderRequest renderRequest, RenderResponse renderResponse)
		throws IOException, PortletException {

		
		HttpServletRequest request = PortalUtil.getHttpServletRequest(renderRequest); 
		
		HttpServletRequest origRequest = PortalUtil.getOriginalServletRequest(request);
		
		ThemeDisplay themeDisplay = (ThemeDisplay) request
			.getAttribute(WebKeys.THEME_DISPLAY);
		
		if(log.isInfoEnabled()){
			log.info("viewing page with id>>" + themeDisplay.getLayout().getPlid());
		}
		
		super.doView(renderRequest, renderResponse);
	}
}
